import { 
    allEnterpriseIdQueryEnterpriseSet
} from '@/api/manage/serviceFee'
import { 
    getEnterpriseOrParkEnabled
} from '@/api/manage/enterprise'
const serviceFee = {
    state: {
        enterpriseServiceFee: {}
    },
    mutations: {
        SET_ENTERPRISE_SERVICEFEE: (state, row) => {
            Object.assign(state.enterpriseServiceFee, row);
        }
    },
    actions: {
        allEnterpriseIdQueryEnterpriseSet({ commit },enterpriseId) {
            return new Promise((resolve, reject) => {
                allEnterpriseIdQueryEnterpriseSet(enterpriseId).then(res => {
                    if (res.code === '1') {
                        commit('SET_ENTERPRISE_SERVICEFEE', res.data)
                        resolve();
                    }
                }).catch(error => {
                    reject(error)
                })
            })
        },
        getEnterpriseOrParkEnabled({ commit },params) {
            return new Promise((resolve, reject) => {
                getEnterpriseOrParkEnabled(params).then(res => {
                    if (res.code === '1') {
                        resolve(res);
                    }
                }).catch(error => {
                    reject(error)
                })
            })
        }
    }
}
export default serviceFee
